﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using HK2009.EntityQuery;
using System.Data;
namespace HK2009.BusinessFacade
{
    public interface ISyClientHandler
    {
        /// <summary>
        /// 根据客户主键ID获取客户信息
        /// </summary>
        /// <param name="pkID"></param>
        /// <returns></returns>
        Sy_ClientQuery GetClient(int pkID);
        
        /// <summary>
        /// 获取所有客户类别
        /// </summary>
        /// <returns></returns>
        DataTable GetClientTypeList();

        /// <summary>
        /// 根据客户代码返回客户列表
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        DataTable GetClientListByCode(string code);

        /// <summary>
        /// 根据sql语句同参数插入客户相关表
        /// </summary>
        /// <param name="sqlStr">sql语句</param>
        /// <param name="parms">参数</param>
        /// <returns></returns>
        bool ClientEdit(string sqlStr, SqlParameter[] parms);

        /// <summary>
        /// 根据客户类型ＩＤ获取客户列表
        /// </summary>
        /// <param name="typeID"></param>
        /// <returns></returns>
        DataTable GetClientListByTypeID(int typeID);
       

        /// <summary>
        /// 根据客户ＩＤ获取客户所属类型
        /// </summary>
        /// <returns></returns>
        DataTable GetClientTypeByID(int id);


        /// <summary>
        /// 根据sql语句同参数获取客户列表
        /// </summary>
        /// <param name="sqlStr">sql语句</param>
        /// <param name="parms">参数</param>
        /// <returns></returns>
        DataTable GetClientList(string sqlStr, SqlParameter[] parms);


        /// <summary>
        /// 根据客户ID获取客户信息把客户删除(状态修改为0）
        /// </summary>
        /// <returns></returns>
        bool ClientDelete(Sy_ClientQuery query);

        /// <summary>
        /// 根据sql语句同参数获取客户联系人列表
        /// </summary>
        /// <param name="sqlStr"></param>
        /// <param name="parms"></param>
        /// <returns></returns>
        DataTable GetClientLinkManList(string sqlStr,SqlParameter[] parms);

        /// <summary>
        /// 根据id获取客户联系人详细信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Sy_ClientLinkManQuery GetClientLinkManByID(int id);

        /// <summary>
        /// 据sql语句同参数添加或修改客户联系人
        /// </summary>
        /// <param name="sqlStr"></param>
        /// <param name="parms"></param>
        /// <returns></returns>
        bool ClientLinkManEdit(string sqlStr,SqlParameter[] parms);

        /// <summary>
        /// 删除客户联系人
        /// </summary>
        /// <returns></returns>
        bool ClientLinkManDelete(int id);

        bool ClientLinkManUpdate(Sy_ClientLinkManQuery query);

        bool ClientLinkManInsert(Sy_ClientLinkManQuery query);

        int GetTypeIDByTypeName(string name);

        string GetTypeNameByTypeID(int typeID);

        DataTable GteLinkMansByClientID(int clientID);
       
        
    }
}
